#include <stdio.h>
int main()
{
    const char* line = "GET /live/ch1.ts P2P/0.1";
    #define LEN_METHOD  10
    #define LEN_PATH        128
    #define LEN_VERSION     24
    char method[LEN_METHOD];
    char path[LEN_PATH];
    char version[LEN_VERSION];

#define LEN 128
    char s[LEN];
    snprintf(s, LEN, "%%%ds %%%ds %%%ds", 
            LEN_METHOD, 
            LEN_PATH, 
            LEN_VERSION);



    int n = sscanf(line, s, method, path, version);
    printf("n=%d\n", n);
    printf("method=[%s]\n", method); 
    printf("path=[%s]\n", path);
    printf("version=[%s]\n", version);

    return 0;
}
